package com.wnxy.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.wnxy.entity.Article;
import com.wnxy.mapper.ArticleMapper;
import com.wnxy.service.IArticleService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ArticleServiceImpl extends ServiceImpl<ArticleMapper, Article> implements IArticleService {
    @Override
    public IPage<Article> findByPage(int current, int size) {
        IPage<Article> page=new Page<>(current,size);

        List<Article> list = baseMapper.findByPage(page);
        page.setRecords(list);
        return page;
    }
}

